#ifndef __HEADER_RSA__
#define __HEADER_RSA__
#include "crypto/types.h"
#include "crypto/tool.h"

struct RSA_suit
{
    uint16 p;
    uint16 q;
    uint n;
    uint e;
    uint m;
    uint64 d;
};
typedef struct RSA_suit RSASuit;

#define RSA_DEFAULT_E 257
#define RSA_MAX_D 4294967295

SAFE_array *RSAEncode(uint N, uint64 E, SAFE_array *plain);
SAFE_array *RSADecode(uint N, uint64 D, SAFE_array *crypto);

void RSASuitPrint(RSASuit *suit);
RSASuit *RSAgetRSASuit(RandomFunc randomFunc);
uint powMod(uint base, uint64 e, uint mod);

#endif